package com.pzhu.gmall.manage.constant;

/**
 * @author 刘鹏 liupeng
 * @date 2019/11/6
 **/
public class SkuConstant {
    public static final String REDIS_PREFIX = "sku:";
    public static final String REDIS_SUFFIX = ":info";
    public static final String REDIS_LOCK_SUFFIX = ":lock";

    public static String getSkuRedisKey(String skuId) {
        StringBuilder stringBuilder = new StringBuilder(REDIS_PREFIX);
        stringBuilder.append(skuId);
        stringBuilder.append(REDIS_SUFFIX);
        return stringBuilder.toString();
    }

    public static String getSkuRedisLockKey(String skuId) {
        StringBuilder stringBuilder = new StringBuilder(REDIS_PREFIX);
        stringBuilder.append(skuId);
        stringBuilder.append(REDIS_LOCK_SUFFIX);
        return stringBuilder.toString();
    }
}
